<div class="vheader">
    <h1><?php echo $this->Locations->d->Name ?></h1>
    <p><?php echo $this->Locations->d->Category ?>
</div>

<div class="vcontent_vfooter2">
    
    <div class="cell dd200">
        <dl>
            <dt><?php echo $this->translate("Name") ?></dt>
            <dd><?php echo $this->Locations->d->Name ?><br /><?php echo $this->Locations->d->ShortName ?></dd>
            <dt><?php echo $this->translate("Category") ?></dt>
            <dd><?php echo $this->Locations->d->Category ?></dd>
            <dt><?php echo $this->translate("Id") ?></dt>
            <dd><?php echo $this->Locations->d->LocationId ?></dd>
            <dt><?php echo $this->translate("Code") ?></dt>
            <dd><?php echo $this->Locations->d->Code ?></dd>
            <dt><?php echo $this->translate("Programs") ?></dt>
            <dd>
                <?php echo $this->Locations->r->programs->count() ? '' : '-' ?>
                <?php foreach($this->Locations->r->programs as $program) echo $program->Program .'<br />' ?>
            </dd>
            <dt><?php echo $this->translate("Phone") ?></dt>
            <dd><?php echo $this->Locations->d->Tel1 ?><br /><?php echo $this->Locations->d->Tel2 ?></dd>
            <dt><?php echo $this->translate("Fax") ?></dt>
            <dd><?php echo $this->Locations->d->Fax ?></dd>
            <dt><?php echo $this->translate("Address") ?></dt>
            <dd><?php echo nl2br($this->Locations->d->Address) ?></dd>
            <dt><?php echo $this->translate("Comments") ?></dt>
            <dd><?php echo nl2br($this->Locations->d->Comments) ?></dd>
        </dl>
    </div>
<?php //echo $this->partial('partials/performance.phtml', $this->Locations->p); ?>
    
    <?php if(isset($this->Locations->p->Score)): ?>
    
    <div class="cell dt200">
        <dl>
            <dt><li class="<?php echo $this->Locations->p->c->Clients ?>"><?php echo $this->translate("Clients") ?></dt>
            <dd><?php echo (int) $this->Locations->p->Clients ?></dd>
            <dt><li class="<?php echo $this->Locations->p->c->FemalePercentage ?>"><?php echo $this->translate("Female percentage") ?></dt>
            <dd><?php echo $this->Locations->p->FemalePercentage ?></dd>
            <dt><li class="<?php echo $this->Locations->p->c->BalancePrincipal ?>"><?php echo $this->translate("Balance") ?></dt>
            <dd><?php echo number_format($this->Locations->p->BalancePrincipal, 2, '.', ',') ?></dd>
            <dt><li class="<?php echo $this->Locations->p->c->Par15 ?>"><?php echo $this->translate("PAR 15") ?></dt>
            <dd><?php echo $this->Locations->p->Par15 ?></dd>
            <dt><li class="<?php echo $this->Locations->p->c->WriteOffPercentage ?>"><?php echo $this->translate("Write-off percentage") ?><sup>1</sup></dt>
            <dd><?php echo $this->Locations->p->WriteOffPercentage ?></dd>
            <dt><li class="<?php echo $this->Locations->p->c->Interest ?>"><?php echo $this->translate("Op. income") ?><sup>1</sup></dt>
            <dd><?php echo number_format($this->Locations->p->Interest, 2, '.', ',') ?></dd>
            <dt><li class="<?php echo $this->Locations->p->c->Disbursements ?>"><?php echo $this->translate("Disbursements") ?><sup>1</sup></dt>
            <dd><?php echo (int) $this->Locations->p->Disbursements ?></dd>
            <dt><li class="<?php echo $this->Locations->p->c->DisbursedAmount ?>"><?php echo $this->translate("Disbursed amount") ?><sup>1</sup></dt>
            <dd><?php echo number_format($this->Locations->p->DisbursedAmount, 2, '.', ',') ?></dd>    
            <dt></dt><dd></dd>   
            <dt><sup>1</sup> <?php echo $this->translate("Previous 30 days") ?></dt><dd></dd>
        </dl>
    </div>

    <div class="cell dt200">
        <dl>
            <dt><li class="<?php echo $this->Locations->p->c->Sustainability ?>"><?php echo $this->translate("Sustainability") ?></dt>
            <dd><?php echo $this->Locations->p->Sustainability ?></dd>
            <dt><li class="<?php echo $this->Locations->p->c->Meetings ?>"><?php echo $this->translate("Bank meetings with leaders") ?></dt>
            <dd><?php echo (int) $this->Locations->p->Meetings ?></dd>
            <dt><li class="<?php echo $this->Locations->p->c->ClientAssistance?>"><?php echo $this->translate("Client assistance") ?><sup>2</sup></dt>
            <dd><?php echo (int) $this->Locations->p->ClientAssistance ?></dd>
            <dt><li class="<?php echo $this->Locations->p->c->PersonalGrowth ?>"><?php echo $this->translate("Personal growth") ?><sup>2</sup></dt>
            <dd><?php echo (int) $this->Locations->p->PersonalGrowth ?></dd>
            <dt><li class="<?php echo $this->Locations->p->c->ChurchMinistry ?>"><?php echo $this->translate("Church ministry") ?><sup>2</sup></dt>
            <dd><?php echo (int) $this->Locations->p->ChurchMinistry ?></dd>
            <dt><li class="<?php echo $this->Locations->p->c->Training ?>"><?php echo $this->translate("Client training") ?><sup>2</sup></dt>
            <dd><?php echo (int) $this->Locations->p->Training ?></dd>
            <dt></dt><dd></dd>   
            <dt><sup>2</sup> <?php echo $this->translate("Surplus monthly hours") ?></dt><dd></dd>
        </dl>
    </div>

    <div>
        <div class="scoreLabel"><?php echo $this->translate("Score") ?></div>
        <div class="scoreBadge">
            <div id="score" class="<?php echo $this->Locations->p->c->Score ?>"><?php echo isset($this->Locations->p->Score) ? $this->Locations->p->Score : ''; ?></div>
        </div>
    </div>
    
    <?php endif; ?>

</div>

<div class="vfooter3">
 <div class="menu">
     <a style="text-decoration: none"><?php echo $this->translate("Loan applications:") ?></a>
     <?php echo $this->link('/loan/application/browse', array('LocationId'=>$this->Locations->d->LocationId,'LocationShortName'=>$this->Locations->d->ShortName,'Status'=>'New'),$this->translate("New"),array('target' => 'bottom')) ?>
     <?php echo $this->link('/loan/application/browse', array('LocationId'=>$this->Locations->d->LocationId,'LocationShortName'=>$this->Locations->d->ShortName,'Status'=>'Rejected'),$this->translate("Rejected"),array('target' => 'bottom')) ?>
     <?php echo $this->link('/loan/loan-master/browse', array('LocationId'=>$this->Locations->d->LocationId,'LocationShortName'=>$this->Locations->d->ShortName,'Status'=>'Submitted'),$this->translate("Submitted"),array('target' => 'bottom')) ?>
     <?php echo $this->link('/loan/loan-master/browse', array('LocationId'=>$this->Locations->d->LocationId,'LocationShortName'=>$this->Locations->d->ShortName,'Status'=>'Re-Submitted'),$this->translate("Re-Submitted"),array('target' => 'bottom')) ?>
     <?php echo $this->link('/loan/loan-master/browse', array('LocationId'=>$this->Locations->d->LocationId,'LocationShortName'=>$this->Locations->d->ShortName,'Status'=>'Reviewed'),$this->translate("Reviewed"),array('target' => 'bottom')) ?>
     <?php echo $this->link('/loan/loan-master/browse', array('LocationId'=>$this->Locations->d->LocationId,'LocationShortName'=>$this->Locations->d->ShortName,'Status'=>'Approved'),$this->translate("Approved"),array('target' => 'bottom')) ?>
     <?php echo $this->link('/loan/loan-master/browse', array('LocationId'=>$this->Locations->d->LocationId,'LocationShortName'=>$this->Locations->d->ShortName,'Status'=>'Executed'),$this->translate("Executed"),array('target' => 'bottom')) ?>
     <?php echo $this->link('/loan/loan-master/browse', array('LocationId'=>$this->Locations->d->LocationId,'LocationShortName'=>$this->Locations->d->ShortName,'Status'=>'Disbursed'),$this->translate("Disbursed"),array('target' => 'bottom')) ?>
     <?php echo $this->link('/loan/loan-master/browse', array('LocationId'=>$this->Locations->d->LocationId,'LocationShortName'=>$this->Locations->d->ShortName,'Status'=>'Withdrawn'),$this->translate("Withdrawn"),array('target' => 'bottom')) ?>
 </div>
</div>

<div class="vfooter2">
 <div class="menu">
     <?php echo $this->link('/loan/active-loan/browse', array('LocationId'=>$this->Locations->d->LocationId,'LocationShortName'=>$this->Locations->d->ShortName),$this->translate("Active loans"),array('target' => 'bottom')) ?>
     <?php echo $this->link('/loan/active-loan/browse', array('LocationId'=>$this->Locations->d->LocationId,'Status'=>'Delinquent','Delinquent'=>'1','LocationShortName'=>$this->Locations->d->ShortName),$this->translate("Delinquent loans"),array('target' => 'bottom')) ?>
     <?php echo $this->link('/loan/legal/browse', array('LocationId'=>$this->Locations->d->LocationId,'Status'=>'Written-Off','LocationShortName'=>$this->Locations->d->ShortName),$this->translate("Written-Off loans"),array('target' => 'bottom', 'text' => true)) ?>
     <?php echo $this->link('/loan/legal/browse', array('LocationId'=>$this->Locations->d->LocationId,'Status'=>'Recovered','LocationShortName'=>$this->Locations->d->ShortName),$this->translate("Recovered loans"),array('target' => 'bottom', 'text' => true)) ?>
     <?php echo $this->link('/loan/loan/browse', array('LocationId'=>$this->Locations->d->LocationId,'Status'=>'Paid','LocationShortName'=>$this->Locations->d->ShortName),$this->translate("Paid loans"),array('target' => 'bottom', 'text' => true)) ?>
     |
     <?php echo $this->link('/admin/client/browse', array('LocationId'=>$this->Locations->d->LocationId,'LocationShortName'=>$this->Locations->d->ShortName),$this->translate("Clients"),array('target' => 'bottom')) ?> 
     <?php echo $this->link('/admin/group/browse', array('LocationId'=>$this->Locations->d->LocationId,'LocationShortName'=>$this->Locations->d->ShortName),$this->translate("Groups"),array('target' => 'bottom')) ?> 
     <?php echo $this->link('/admin/bank/browse', array('LocationId'=>$this->Locations->d->LocationId,'LocationShortName'=>$this->Locations->d->ShortName),$this->translate("Banks"),array('target' => 'bottom')) ?> 
     <?php echo $this->link('/admin/community/browse', array('LocationId'=>$this->Locations->d->LocationId,'LocationShortName'=>$this->Locations->d->ShortName),$this->translate("Communities"),array('target' => 'bottom')) ?> 
     <?php echo $this->link('/admin/story/browse', array('LocationId'=>$this->Locations->d->LocationId,'LocationShortName'=>$this->Locations->d->ShortName),$this->translate("Stories"),array('target' => 'bottom')) ?> 
 </div>
</div>

<div class="vfooter">
 <div class="menu">
     <?php echo $this->link('/admin/performance-metric-location/browse', array('LocationId'=>$this->Locations->d->LocationId,'LocationShortName'=>$this->Locations->d->ShortName),$this->translate("Custom metrics"),array('target' => 'bottom', 'text' => true)) ?>
     <?php echo $this->link('/admin/performance-metric-location/add', array('LocationId'=>$this->Locations->d->LocationId),$this->translate("Add custom metric"),array('text' => true)) ?>
     <?php echo $this->link('/admin/performance-data/browse', array('LocationId'=>$this->Locations->d->LocationId,'LocationShortName'=>$this->Locations->d->ShortName),$this->translate("Performance data"),array('target' => 'bottom', 'text' => true)) ?>
     <?php echo $this->link('/admin/location/performance-chart', array('id'=>$this->Locations->d->LocationId),$this->translate("Performance charts")) ?>
     |
     <?php echo $this->link('/admin/performance-data-xtra/location', array('id'=>$this->Locations->d->LocationId),$this->translate("Update sustainability"),array('text' => true)) ?>
     |
     <?php echo $this->link('/admin/location/add', array('id' => $this->Locations->d->LocationId), $this->translate("Edit")); ?>
     <?php echo $this->link('/admin/location/map', array('id' => $this->Locations->d->LocationId), $this->translate("Map")); ?>
 </div>
</div>
     
<!-- Tooltips -->
<div data-dojo-type="dijit.Tooltip" data-dojo-props="connectId:'score',position:['below']">
    <?php echo $this->translate("Performance score") ?>
</div>
<!-- Tooltips /-->